package dyyx.server;

import java.net.InetSocketAddress;
import java.util.Date;

import com.sun.net.httpserver.HttpServer;


public class SimpleHttpServer {
	
	public static void main(String[] args) throws Exception {
		
		
		int port = 8000;
		
		HttpServer server = HttpServer.create(new InetSocketAddress(port), 0);
	    server.createContext("/hello", new HelloHandler());
	    server.createContext("/", new DefaultHandler());

	    // creates a default executor
	    server.setExecutor(null); 
	    server.start();
	    
	    System.out.println("httpserver start,port="+port+","+new Date());
		
		
	
	}
}
